import sys
from PyQt6.QtWidgets import QApplication,QWidget,QVBoxLayout
from qfluentwidgets import setTheme, Theme, PushButton, PrimaryPushButton, SwitchButton, ComboBox, LineEdit, InfoBar, \
    InfoBarPosition


class FluentDemo(QWidget):
    def __init__(self):
        super().__init__()
        self.setWindowTitle('PyQt6-Fluent-Widgets Demo')
        self.setGeometry(100, 100, 800, 600)

        layout = QVBoxLayout()
        self.setLayout(layout)

        setTheme(Theme.DARK)

        button=PushButton('Click Me')
        button.clicked.connect(self.show_info)
        layout.addWidget(button)

        primary_button=PrimaryPushButton('primary button')
        layout.addWidget(primary_button)

        switch=SwitchButton('toggle me')
        layout.addWidget(switch)

        combo=ComboBox()
        combo.addItems(['Option1','Option2','Option3'])
        layout.addWidget(combo)

        line_edit=LineEdit()
        line_edit.setPlaceholderText('Enter text here')
        layout.addWidget(line_edit)

    def show_info(self):
        InfoBar.success(
            title='Success',
            content='You clicked the button!',
            position=InfoBarPosition.TOP,
            parent=self
        )
        print('Button clicked!')
if __name__ == '__main__':
    app = QApplication(sys.argv)
    demo = FluentDemo()
    demo.show()
    sys.exit(app.exec())
